package commonSources;

import java.io.Serializable;
import java.util.Hashtable;

// <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
// #[regen=yes,id=DCE.836665F3-9D46-26BD-5435-937C37C80DEF]
// </editor-fold> 
public class Cliente implements Serializable {

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.569B8B32-E878-965A-0A72-DEFC246F5786]
    // </editor-fold> 
    private Hashtable<String, Conta> contas;
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.65935111-AB9E-0DD5-A5B9-6491A7D9CFC2]
    // </editor-fold> 
    private String id;
    private String nome;
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.93DE05FF-B752-5341-4855-6E553F5FFF49]
    // </editor-fold> 
    private Painel painel;

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.AAE4E9CE-D183-9805-B6CD-A58AB6D34018]
    // </editor-fold> 
    public Cliente(String nome, String id) {
        this.nome = nome;
        this.id = id;
        contas = new Hashtable<String, Conta>();
        contas.put(1+id, new Conta(1+id));
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,regenBody=yes,id=DCE.A0A10903-4161-BCF9-E9CF-D4ACEE683F85]
    // </editor-fold> 
    public String getId() {
        return id;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,regenBody=yes,id=DCE.68914049-125F-3D79-5024-37BCCC35C356]
    // </editor-fold> 
    public void setId(String val) {
        this.id = val;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,regenBody=yes,id=DCE.0B067AC1-875F-CE5E-CF22-1F9EC5D7F7B7]
    // </editor-fold> 
    public Hashtable<String, Conta> getContas() {
        return contas;
    }

    public int numContas() {
        if (getContas() != null) {
            return getContas().size();
        } else {
            return 0;
        }
    }

    public Conta getConta(String idConta) {
        return contas.get(idConta);
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,regenBody=yes,id=DCE.0F18CD8F-E8A9-B99A-D358-C244E4C4C4BF]
    // </editor-fold> 
    public void setContas(Hashtable<String, Conta> val) {
        this.contas = val;
    }

    public void adicionaConta(Conta conta) {
        this.contas.put(conta.getNumConta(), conta);
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,regenBody=yes,id=DCE.0A138BB6-CD39-42A3-CE38-BA93479453FB]
    // </editor-fold> 
    public Painel getPainel() {
        return painel;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,regenBody=yes,id=DCE.D50B3919-B4C6-46DF-28BD-4E143C1BE052]
    // </editor-fold> 
    public void setPainel(Painel val) {
        this.painel = val;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }
}

